

package cn.shengchao.examstar.distribute.ohs.local.appservice;

import cn.shengchao.examstar.distribute.infrastrure.po.DistributeNodeRoleChain;
import cn.shengchao.examstar.rpc.distribute.dto.DistributeNodeBaseCreateDto;
import cn.shengchao.examstar.rpc.distribute.dto.DistributeNodeInfoChangeNodeDto;
import cn.shengchao.examstar.rpc.distribute.dto.DistributeNodeInfoEmployeeLeaveDto;
import cn.shengchao.examstar.rpc.distribute.dto.DistributeNodeInfoPercentDto;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @program: examstarapi
 * @description: 用户分销链综合业务处理接口
 * @author: Xiong weiqiang
 * @create: 2025-03-25 20:07
 */
public interface DistributeNodeRoleChainDomainService {

    void createDistributeNodeAndRoleChainAfterClean(DistributeNodeBaseCreateDto distributeNodeInfoCreateDto);


    void editDistributeUserStablePercent(DistributeNodeInfoPercentDto distributeUserInfoPercentDto);

    void changeDistributeUserUpLevelNode(DistributeNodeInfoChangeNodeDto distributeUserInfoChangeNodeDto);

    void changeDistributeUserEmployeeLeave(DistributeNodeInfoEmployeeLeaveDto distributeNodeInfoEmployeeLeaveDto);

    /**
     * 获取分销商下属所有的销售用户id
     *
     * @param userId (加盟商用户id)
     */
    List<DistributeNodeRoleChain> getAllSaleNodeId(Long nodeId);

    /**
     * 取分销商下属所有的对应角色销售用户id
     *
     * @param userId
     * @param role
     * @return
     */
    List<DistributeNodeRoleChain> getAllSaleUserIdByRole(Long nodeId, String role);

    Map<Long,Set<Long>> getLowNodeUserIds(Integer distributeType,List<Long> userIds, String distributeRoleCode);
}